package com.learn.observer.normal;

import com.learn.observer.WeatherType;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * <p>项目名称: design-pattern </p>
 * <p>文件名称: Tv </p>
 * <p>描述: Tv订阅 </p>
 */
@Slf4j
@Getter
@Setter
public class Tv implements WeatherObserver {

    private String name;

    public Tv(String name) {
        this.name = name;
    }

    @Override
    public void update(WeatherType currentWeather, String detail) {
        switch (currentWeather){
            case SUNNY:
                log.info("{}当前天气转晴,{}提示{}的朋友有个好心情",detail,name,detail);
                break;
            case COLD:
                log.info("{}当前天气转凉,{}提示{}的朋友注意保暖",detail,name,detail);
                break;
            case WINDY:
                log.info("{}当前天气有强风,{}提示{}的朋友注意防风",detail,name,detail);
                break;
            case RAINY:
                log.info("{}当前天气有雨,{}提示{}的朋友出门注意携带雨具",detail,name,detail);
                break;
        }
    }
}
